class todo:
    def __init__(self,name):
        self.name=name

    def lesson(self,lesson_name):
        print("学生",self.name,"来上",lesson_name,"课")

    def __del__(self):
        print("下课了")

class todo2:
    def __init__(self,name):
        self.name=name

    def play(self,lesson_name):
        print("学生",self.name,"去",lesson_name,"玩")

    def __del__(self):
        print("玩完了")

zhang=todo("xiaozhang")
zhang.lesson("python")

li=todo2("xiaoli")
li.play("网吧")

#魔法方法
